﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.nickro.project.BulkLoad {
    import flash.events.*;

    public class BulkProgressEvent extends ProgressEvent {

        public static const COMPLETE:String = "complete";
        public static const PROGRESS:String = "progress";

        public var name:String;
        public var bytesTotalCurrent:int;
        public var itemsTotal:int;
        public var itemsLoaded:int;
        public var _percentLoaded:Number;
        public var _weightPercent:Number;
        public var _ratioLoaded:Number;

        public function BulkProgressEvent(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false){
            super(_arg1, _arg2, _arg3);
            this.name = _arg1;
        }
        public function loadingStatus():String{
            var _local1:Array = [];
            _local1.push(("bytesLoaded: " + bytesLoaded));
            _local1.push(("bytesTotal: " + bytesTotal));
            _local1.push(("itemsLoaded: " + this.itemsLoaded));
            _local1.push(("itemsTotal: " + this.itemsTotal));
            _local1.push(("bytesTotalCurrent: " + this.bytesTotalCurrent));
            _local1.push(("percentLoaded: " + BulkLoader.truncateNumber(this.percentLoaded)));
            _local1.push(("weightPercent: " + BulkLoader.truncateNumber(this.weightPercent)));
            _local1.push(("ratioLoaded: " + BulkLoader.truncateNumber(this.ratioLoaded)));
            return ((("BulkProgressEvent " + _local1.join(", ")) + ";"));
        }
        public function set percentLoaded(_arg1:Number):void{
            if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
                _arg1 = 0;
            };
            this._percentLoaded = _arg1;
        }
        public function set weightPercent(_arg1:Number):void{
            if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
                _arg1 = 0;
            };
            this._weightPercent = _arg1;
        }
        override public function clone():Event{
            var _local1:BulkProgressEvent = new BulkProgressEvent(this.name, bubbles, cancelable);
            _local1.setInfo(bytesLoaded, bytesTotal, this.bytesTotalCurrent, this.itemsLoaded, this.itemsTotal, this.weightPercent);
            return (_local1);
        }
        public function set ratioLoaded(_arg1:Number):void{
            if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
                _arg1 = 0;
            };
            this._ratioLoaded = _arg1;
        }
        public function get percentLoaded():Number{
            return (this.truncateToRange(this._percentLoaded));
        }
        override public function toString():String{
            return (super.toString());
        }
        public function get weightPercent():Number{
            return (this.truncateToRange(this._weightPercent));
        }
        public function setInfo(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:Number):void{
            this.bytesLoaded = _arg1;
            this.bytesTotal = _arg2;
            this.bytesTotalCurrent = _arg3;
            this.itemsLoaded = _arg4;
            this.itemsTotal = _arg5;
            this.weightPercent = _arg6;
            this.percentLoaded = ((_arg2 > 0)) ? (_arg1 / _arg2) : 0;
            this.ratioLoaded = ((_arg5 == 0)) ? 0 : (_arg4 / _arg5);
        }
        public function get ratioLoaded():Number{
            return (this.truncateToRange(this._ratioLoaded));
        }
        public function truncateToRange(_arg1:Number):Number{
            if (_arg1 < 0){
                _arg1 = 0;
            } else {
                if (_arg1 > 1){
                    _arg1 = 1;
                } else {
                    if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
                        _arg1 = 0;
                    };
                };
            };
            return (_arg1);
        }

    }
}//package org.nickro.project.BulkLoad 
